import {post , get,upload} from '@/utils/request.js';

export function uploadFile(url,file,data,config){
  return upload(url,file,data,config);
}

export function hasUploadChunks(fileHash){
  return get(`/video/hasUploadChunks/${fileHash}`);
}

export function uploadVideoInfo(data){
  return post('/video/uploadVideoInfo',data);
}

export function getVideoInfo(uid){
  return get(`/video/getVideoInfo/${uid}`);
}

export function videoRecommend(data){
  return post(`/video/videoCommend`,data);
}

export function userRecommend(data){
  return post('/video/userCommend',data);
}

/**
 * 用户已登录状态观看视频
 * @param {Object} data 
 * @returns 
 */
export function updateVideoInfo(data){
  return post(`/video/updateVideoInfo`,data);
}

/**
 * 未登录状态观看视频
 * @param {Object} data 
 * @returns 
 */
export function tourist(data){
  return post(`/video/tourist`,data);
}

/**
 * 用户对视频id为vid的行为
 * @param {String} vid 
 * @returns 
 */
export function userBehavior(vid) {
  return get(`/video/userBehavior/${vid}`);
}